//
//  DataBase.h
//  Funny
//
//  Created by dllo on 15/11/3.
//  Copyright © 2015年 King. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "FoodInfoModel.h"

@interface DataBase : NSObject

@property (nonatomic, strong) FMDatabase *dataBase;

+ (DataBase *)shareDataBase;
- (BOOL)open;
- (BOOL)close;
- (BOOL)creatTable;
- (BOOL)insertDataWithModel:(MainIntroductionModel *)model;
- (BOOL)deleteDataWithModel:(MainIntroductionModel *)model;
- (BOOL)upDataWithNewModel:(MainIntroductionModel *)model;
- (NSArray *)getAll;

- (BOOL)creatDetailTable;
- (BOOL)insertDetailDataWithModel:(Detail *)model;
- (BOOL)deleteDetailDataWithModel:(Detail *)model;
- (BOOL)upDetailDataWithNewModel:(Detail *)model;
- (NSArray *)getDetailAll;

- (BOOL)creatInlandTable;
- (BOOL)insertInlandDataWithModel:(FoodInfoModel *)model;
- (BOOL)deleteInlandDataWithModel:(FoodInfoModel *)model;
- (BOOL)updateInlandDataWithNewModel:(FoodInfoModel *)model;
- (NSArray *)getInlandAll;

@end
